﻿Imports DTO
Public Class DATerminalUserData

    Inherits DataProvider
    Shared Sub ConfigServerName(ByVal serverName As String)

        ' call constructor base class
        ConfigServer(serverName)

    End Sub

    '/******************************************************************/
    '/*             Lay datatable tu DataProvider voi SP               */
    '/******************************************************************/
    Shared Function GetAllTerminalUserData() As DataTable
        Return Query("getAllTerminalUserData")
    End Function

    '/******************************************************************/
    '/*                      Insert Terminal User Data                 */
    '/******************************************************************/
    Shared Function InsertTerminalUserData(ByVal dtoTerminalUserData As DTOTerminalUserData) As Integer
        Return Update("insertTerminalUserData", {"@id", "@backup",
                                                       "@machinePrivilege", "@enrollData", "@status",
                                                       "@createDateTime", "@updateDateTime"},
                                                        {dtoTerminalUserData.IdProperty, dtoTerminalUserData.BackupProperty,
                                                                                               dtoTerminalUserData.MachinePrivilegeProperty, dtoTerminalUserData.EnrollDataProperty,
                                                                                               dtoTerminalUserData.StatusProperty, dtoTerminalUserData.CreateDateTimeProperty,
                                                                                               dtoTerminalUserData.UpdateDateTimeProperty})
    End Function

    '/******************************************************************/
    '/*                      Update TerminalSetting                    */
    '/******************************************************************/
    Shared Function UpdateTerminalSetting(ByVal dtoTerminalUserData As DTOTerminalUserData) As Integer
        Return Update("updateTerminalUserData", {"@id", "@backup",
                                                       "@machinePrivilege", "@enrollData", "@status",
                                                       "@updateDateTime"},
                                                        {dtoTerminalUserData.IdProperty, dtoTerminalUserData.BackupProperty,
                                                                                               dtoTerminalUserData.MachinePrivilegeProperty, dtoTerminalUserData.EnrollDataProperty,
                                                                                               dtoTerminalUserData.StatusProperty,
                                                                                               dtoTerminalUserData.UpdateDateTimeProperty})
    End Function

End Class
